export function debounce(callback: () => void, delay: number = 2000) {
  let timer: NodeJS.Timeout | null = null;
  return () => {
    if (timer) timer = null;
    timer = setTimeout(() => {
      callback();
    }, delay);
  };
}
